#include "app_buffer.h"
#include "log/log.h"

int main(int argc, char const *argv[])
{
    Buffer *buffer = app_buffer_init(12);
    app_buffer_write(buffer, "abcd", 4);
    app_buffer_write(buffer, "efghi", 5);
    char buff1[4];
    app_buffer_read(buffer, buff1, 4);
    log_debug("buff1: %s", buff1);  // abcd
    app_buffer_write(buffer, "jklmno", 6);
    char buff2[5];
    app_buffer_read(buffer, buff2, 5);
    log_debug("buff2: %s", buff2);  // efghi
    char buff3[6];
    app_buffer_read(buffer, buff3, 6); // jklmno
    log_debug("buff3: %s", buff3);

    return 0;
}
